package com.example.product_practices.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.product_practices.domain.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Mapper
@Transactional(rollbackFor = Exception.class)
public interface UserMapper extends BaseMapper<User> {
    @Select("select * from user where auth = 2")
    List<User> getAllRenter();

    @Select("select * from user where auth = 2 limit #{current},#{size}")
    List<User> getRenterPage(int current,int size);

    @Select("select id from user where username = #{name}")
    int getId(String name);
}
